package com.tieto.person;

import javax.jws.WebService;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * WebService implementation of PersonManagement. All that is needed is @WebService
 * annotation, which is from JAX-WS specification. WebService implementation can
 * be switched from CXF to something else by editing application-context.
 */
@WebService(endpointInterface = "com.tieto.person.PersonManagement")
public class PersonManagementImpl implements PersonManagement {
	private final Logger logger = LoggerFactory.getLogger(getClass());

	@Override
	public String sayHello(String name) {
		Person person = new Person(name);
		logger.info("sayHello: {}", name);
		return "Hello " + person.getName() + "!";
	}

	@Override
	public Person[] getPersons() {
		Person[] persons = new Person[1];
		persons[0] = new Person("Joe");
		return persons;
	}
}
